﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Collections;
using Utility.UI;
using System.Data;
using System.Text;
using Utility.Tool;

namespace MSL.CodeMatic.App_Code
{
    /// <summary>
    /// 基类
    /// </summary>
    public class PageBase : System.Web.UI.Page
    {
        protected override void OnLoad(EventArgs e)
        {
            #region 当Session过期自动跳出登录画面
            if (Session["ServerName"] == null || Session["ServerName"].ToString().Length == 0)
            {
                Session.Abandon();  //取消当前会话
                Session.Clear();
                Response.Redirect("/Index.htm");
            }
            #endregion

            #region 防止刷新重复提交
            if (null == Session["Token"])
            {
                //WebHelper.SetToken();
            }
            #endregion

            base.OnLoad(e);
        }
    }
}